<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter&nbsp;3.&nbsp;Database Manager</title>
<link href="../docbook.css" type="text/css" rel="stylesheet">
<meta content="DocBook XSL-NS Stylesheets V1.76.1" name="generator">
<meta name="keywords" content="Hsqldb, Database, Manager">
<meta name="keywords" content="HyperSQL, Hsqldb, Hypersonic, Database, JDBC, Java">
<link rel="home" href="index.html" title="HyperSQL Utilities Guide">
<link rel="up" href="index.html" title="HyperSQL Utilities Guide">
<link rel="prev" href="test-utility-chapt.html" title="Chapter&nbsp;2.&nbsp;Hsqldb Test Utility">
<link rel="next" href="transfer-tool-chapt.html" title="Chapter&nbsp;4.&nbsp;Transfer Tool">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table summary="Navigation header" width="100%">
<tr>
<td align="left" width="30%"><a accesskey="p" href="test-utility-chapt.html"><img src="../images/db/prev.png" alt="Prev"></a>&nbsp;</td><td align="center" width="40%" style="font-weight:bold;">Chapter&nbsp;3.&nbsp;Database Manager</td><td align="right" width="30%">&nbsp;<a accesskey="n" href="transfer-tool-chapt.html"><img src="../images/db/next.png" alt="Next"></a></td>
</tr>
<tr>
<td valign="top" align="left" width="30%">Chapter&nbsp;2.&nbsp;Hsqldb Test Utility&nbsp;</td><td align="center" width="40%"><a accesskey="h" href="index.html"><img src="../images/db/home.png" alt="Home"></a></td><td valign="top" align="right" width="30%">&nbsp;Chapter&nbsp;4.&nbsp;Transfer Tool</td>
</tr>
</table>
</div>
<HR>
<div class="chapter" title="Chapter&nbsp;3.&nbsp;Database Manager">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="dbm-chapt"></a>Chapter&nbsp;3.&nbsp;Database Manager</h2>
</div>
<div>
<div class="authorgroup">
<div class="author">
<h3 class="author">
<span class="firstname">Fred</span> <span class="surname">Toussi</span>
</h3>
<div class="affiliation">
<span class="orgname">The HSQL Development Group<br>
</span>
</div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Blaine</span> <span class="surname">Simpson</span>
</h3>
<div class="affiliation">
<span class="orgname">The HSQL Development Group<br>
</span>
</div>
</div>
</div>
</div>
<div>
<p class="releaseinfo">$Revision: 5063 $</p>
</div>
<div>
<p class="pubdate">2015-06-29 22:27:55-0400</p>
</div>
</div>
</div>
<div class="toc">
<p>
<b>Table of Contents</b>
</p>
<dl>
<dt>
<span class="section"><a href="dbm-chapt.html#dbm_intro-sect">Brief Introduction</a></span>
</dt>
<dt>
<span class="section"><a href="dbm-chapt.html#dbm_tree-sect">Auto tree-update</a></span>
</dt>
<dt>
<span class="section"><a href="dbm-chapt.html#dbm-autoconn-sect">Automatic Connection</a></span>
</dt>
<dt>
<span class="section"><a href="dbm-chapt.html#dbm_rcfile-sect">RC File</a></span>
</dt>
<dt>
<span class="section"><a href="dbm-chapt.html#dbm_wold-sect">Using the current DatabaseManagers with an older HSQLDB
      distribution.</a></span>
</dt>
<dt>
<span class="section"><a href="dbm-chapt.html#dbm_applet-sect">DatabaseManagerSwing as an Applet</a></span>
</dt>
</dl>
</div>
<div class="section" title="Brief Introduction">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="dbm_intro-sect"></a>Brief Introduction</h2>
</div>
</div>
</div>
<p>The Database Manager tool is a simple GUI database query tool with
      a tree display of the tables. Both AWT and SWING versions of the tool
      are available and work almost identically. The AWT version class name is
      org.hsqldb.util.DatabaseManager; the SWING version,
      org.hsqldb.util.DatabaseManagerSwing. The SWING version has more
      refinements than the AWT version.</p>
<p>The AWT version of the database manager can be deployed as an
      applet in a browser. A demo HTML file with an embedded Database Manager
      is included in the /demo directory.</p>
<p>When the Database Manager is started, a dialogue allows you to
      enter the JDBC driver, URL, user and password for the new connection. A
      drop-down box, Type, offers preset values for JDBC driver and URL for
      most popular database engines, including HSQLDB. Once you have selected
      an item from this drop-down box, you should edit the URL to specify the
      details of the database or any additional properties to pass. You should
      also enter the username and password before clicking on the OK
      button.</p>
<p>The connection dialogue allows you to save the settings for the
      connection you are about to make. You can then access the connection in
      future sessions. To save a connection setting, enter a name in the
      Setting Name box before clicking on the OK button. Next time the
      connection dialogue is displayed, the drop-down box labelled Recent will
      include the name for all the saved connection settings. When you select
      a name, the individual settings are displayed in the appropriate
      boxes.</p>
<p>The small Clr button next to the drop-down box allows you to clear
      all the saved settings. If you want to modify an existing setting, first
      select it from the drop-down box then modify any of the text boxes
      before making the connection. The modified values will be saved.</p>
<p>Most SWING menu items have context-sensitive tool tip help text
      which will appear if you hold the mouse cursor still over the desired
      menu item. (Assuming that you don't turn Tooltips off under the
      <span class="guimenu">Help</span> menu.</p>
<p>The database object tree in the SWING version allows you to
      right click on the name of a table or column and choose from common SQL
      statements for the object, for example SELECT * FROM thistable ... If
      you click on one of the given choices, the sample statement is copied to
      the command window, where you can modify and complete it.</p>
<p>The DatabaseManagers do work with HSQLDB servers serving
      TLS-encrypted JDBC data. See the TLS section of the Listeners chapter of
      the <a class="link" href="distro_baseurl_DEFAULTVAL/guide/index.html" target="_top">
      HyperSQL User Guide</a>
</p>
<div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;">
<table border="0" summary="Tip">
<tr>
<td valign="top" align="center" rowspan="2" width="25"><img alt="[Tip]" src="../images/db/tip.png"></td><th align="left">Tip</th>
</tr>
<tr>
<td valign="top" align="left">
<p>If you are using DatabaseManagerSwing with Oracle, you will
        want to make sure that <span class="guimenuitem">Show row counts</span> and
        <span class="guimenuitem">Show row counts</span> are both off
        <span class="emphasis"><em>before connecting to the database</em></span>. You may also
        want to turn off Auto tree-update, as described in the next
        section.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="section" title="Auto tree-update">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="dbm_tree-sect"></a>Auto tree-update</h2>
</div>
</div>
</div>
<p>By default, the object tree in the left panel is refreshed when
      you execute DDL which may update those objects. If you are on a slow
      network or performance-challenged PC, use the <span class="guimenu">view</span> /
      <span class="guimenuitem">Auto-refresh tree</span> menu item to turn it off.
      You will then need to use the
      <span class="guimenu">view</span><span class="guimenuitem">Refresh tree</span> menu item
      every time that you want to refresh the tree.</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table border="0" summary="Note">
<tr>
<td valign="top" align="center" rowspan="2" width="25"><img alt="[Note]" src="../images/db/note.png"></td><th align="left">Note</th>
</tr>
<tr>
<td valign="top" align="left">
<p>Auto-refresh tree does not automatically show all updates to
        database objects, it only refreshes when you submit DDL which may
        update database objects. (This behavior is a compromise between
        utility and performance).</p>
</td>
</tr>
</table>
</div>
</div>
<div class="section" title="Automatic Connection">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="dbm-autoconn-sect"></a>Automatic Connection</h2>
</div>
</div>
</div>
<p>You can use command-line switches to supply connection
      information. If you use these switch(es), then the connection dialog
      window will be skipped and a JDBC connection will be established
      immediately. Assuming that the <code class="filename">hsqldb.jar</code> (or an
      alternative jar) are in your <code class="varname">CLASSPATH</code>, this command
      will list the available command-line options. </p>
<div class="informalexample">
<pre class="screen">    java org.hsqldb.util.DatabaseManagerSwing --help</pre>
</div>
<p>It's convenient to skip the connection dialog window if you
      always work with the same database account.</p>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<table border="0" summary="Warning">
<tr>
<td valign="top" align="center" rowspan="2" width="25"><img alt="[Warning]" src="../images/db/warning.png"></td><th align="left">Warning</th>
</tr>
<tr>
<td valign="top" align="left">
<p>Use of the --password switch is not secure. Everything typed
        on command-lines is generally available to other users on the
        computer. The problem is compounded if you use a network connection to
        obtain your command line. The RC File section explains how you can set
        up automatic connections without supplying a password on the command
        line.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="section" title="RC File">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="dbm_rcfile-sect"></a>RC File</h2>
</div>
</div>
</div>
<p>You can skip the connection dialog window securely by putting
      the connection information into an RC file and then using the
      <code class="literal">--urlid</code> switch to DatabaseManager or
      DatabaseManagerSwing. This strategy is great for adding launch menu
      items and/or launch icons to your desktop. You can set up one icon for
      each of the database accounts which you regularly use.</p>
<p>The default location for the RC file is
      <code class="filename">dbmanager.rc</code> in your home directory. The <a class="link" href="sqltool-chapt.html#sqltool_auth-sect" title="RC File Authentication Setup">RC File Authentication Setup</a> section
      explains how to put the connection information into this text file. If
      you also run <a class="link" href="sqltool-chapt.html" title="Chapter&nbsp;1.&nbsp;SqlTool">SqlTool</a>, then you can share the RC file with
      SqlTool by using a sym-link (if your operating system supports sym
      links), or by using the <code class="literal">--rcfile</code> switch for either
      SqlTool or DatabaseManagerSwing.</p>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<table border="0" summary="Warning">
<tr>
<td valign="top" align="center" rowspan="2" width="25"><img alt="[Warning]" src="../images/db/warning.png"></td><th align="left">Warning</th>
</tr>
<tr>
<td valign="top" align="left">
<p>Use your operating system facilities to prevent others from
        reading your RC file, since it contains passwords.</p>
</td>
</tr>
</table>
</div>
<p>To set up launch items/icons, first experiment on your command
      line to find exactly what command works. For example, </p>
<div class="informalexample">
<pre class="screen">java -cp /path/to/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing --urlid mem</pre>
</div>
<p> Then, use your window manager to add an item that
      runs this command.</p>
</div>
<div class="section" title="Using the current DatabaseManagers with an older HSQLDB distribution.">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="dbm_wold-sect"></a>Using the current DatabaseManagers with an older HSQLDB
      distribution.</h2>
</div>
</div>
</div>
<p>This procedure will allow users of a legacy version of HSQLDB
      to use all of the new features of the DatabaseManagers. You will also
      get the new version of the SqlTool! This procedure works for distros
      going back to 1.7.3.3 at least, probably much farther.</p>
<p>These instructions assume that you are capable of running an
      Ant build. See the Building Appendix of the <a class="link" href="distro_baseurl_DEFAULTVAL/guide/index.html" target="_top"> HyperSQL User
      Guide</a>.</p>
<div class="procedure">
<ol class="procedure" type="1">
<li class="step" title="Step 1">
<p>Download and extract a current HSQLDB distribution. If you
          don't want to use the source code, documentation, etc., you can use
          a temporary directory and remove it afterwards.</p>
</li>
<li class="step" title="Step 2">
<p>Cd to the build directory under the root directory where
          you extracted the distribution to.</p>
</li>
<li class="step" title="Step 3">
<p>Run <code class="literal">ant hsqldbutil</code>.</p>
</li>
<li class="step" title="Step 4">
<p>If you're going to wipe out the build directory, copy
          <code class="filename">hsqldbutil.jar</code> to a safe location
          first.</p>
</li>
<li class="step" title="Step 5">
<p>For now on, whenever you are going to run DatabaseManager*,
          make sure that you have this <code class="filename">hsqldbutil.jar</code> as
          the first item in your <code class="varname">CLASSPATH</code>.</p>
</li>
</ol>
</div>
<p>Here's a UNIX example where somebody wants to use the new
      DatabaseManagerSwing with their older HSQLDB database, as well as with
      Postgresql and a local application. </p>
<div class="informalexample">
<pre class="screen">CLASSPATH=/path/to/hsqldbutil.jar:/home/bob/myapp/classes:/usr/local/lib/pg.jdbc3.jar
export CLASSPATH
java org.hsqldb.util.DatabaseManagerSwing --urlid urlid</pre>
</div>
</div>
<div class="section" title="DatabaseManagerSwing as an Applet">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="dbm_applet-sect"></a>DatabaseManagerSwing as an Applet</h2>
</div>
</div>
</div>
<p>DatabaseManagerSwing is also an applet. You can use it in HTML,
      JSPs, etc. Be aware that in Applet mode, actions to load or save local
      files will be disabled, and attempts to access any server other than the
      HTML-serving-host will fail.</p>
<p>Since the Applet can not store or load locally saved preferences,
      the only way to have persistent preference settings is by using Applet
      parameters. </p>
<div class="variablelist" title="DatabaseManagerSwing Applet Parameters">
<p class="title">
<b>DatabaseManagerSwing Applet Parameters</b>
</p>
<table border="0">
<col valign="top" align="left">
<tbody>
<tr>
<td>
<p>
<span class="term">jdbcUrl</span>
</p>
</td><td>URL of a data source to auto-connect to. String
              value.</td>
</tr>
<tr>
<td>
<p>
<span class="term">jdbcDriver</span>
</p>
</td><td>URL of a data source to auto-connect to. String value.
              Defaults to
              <code class="classname">org.hsqldb.driver.JDBCDriver</code>.</td>
</tr>
<tr>
<td>
<p>
<span class="term">jdbcUser</span>
</p>
</td><td>User name for data source to auto-connect to. String
              value.</td>
</tr>
<tr>
<td>
<p>
<span class="term">jdbcPassword</span>
</p>
</td><td>Password for data source to auto-connect to. String
              value. Defaults to zero-length string.</td>
</tr>
<tr>
<td>
<p>
<span class="term">schemaFilter</span>
</p>
</td><td>Display only object from this schema in the object
              navigator. String value.</td>
</tr>
<tr>
<td>
<p>
<span class="term">laf</span>
</p>
</td><td>Look-and-feel. String value.</td>
</tr>
<tr>
<td>
<p>
<span class="term">loadSampleData</span>
</p>
</td><td>Auto-load sample data. Boolean value. Defaults to
              false.</td>
</tr>
<tr>
<td>
<p>
<span class="term">autoRefresh</span>
</p>
</td><td>Auto-refresh the object navigator when DDL
              modifications detected in user SQL commands. Boolean value.
              Defaults to true.</td>
</tr>
<tr>
<td>
<p>
<span class="term">showRowCounts</span>
</p>
</td><td>Show number of rows in each table in the object
              navigator. Boolean value. Defaults to false.</td>
</tr>
<tr>
<td>
<p>
<span class="term">showSysTables</span>
</p>
</td><td>Show system tables in the object navigator. Boolean
              value. Defaults to false.</td>
</tr>
<tr>
<td>
<p>
<span class="term">showSchemas</span>
</p>
</td><td>Show object names like schema.name in object navigator.
              Boolean value. Defaults to true.</td>
</tr>
<tr>
<td>
<p>
<span class="term">resultGrid</span>
</p>
</td><td>Show query results in Gui grid (as opposed to in plain
              text). Boolean value. Defaults to true.</td>
</tr>
<tr>
<td>
<p>
<span class="term">showToolTips</span>
</p>
</td><td>Show help hover-text. Boolean value. Defaults to
              true.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<HR xmlns:xi="http://www.w3.org/2001/XInclude">
<P xmlns:xi="http://www.w3.org/2001/XInclude" class="svnrev">$Revision: 5063 $</P>
<div class="navfooter">
<hr>
<table summary="Navigation footer" width="100%">
<tr>
<td align="left" width="40%"><a accesskey="p" href="test-utility-chapt.html"><img src="../images/db/prev.png" alt="Prev"></a>&nbsp;</td><td align="center" width="20%">&nbsp;</td><td align="right" width="40%">&nbsp;<a accesskey="n" href="transfer-tool-chapt.html"><img src="../images/db/next.png" alt="Next"></a></td>
</tr>
<tr>
<td valign="top" align="left" width="40%">Chapter&nbsp;2.&nbsp;Hsqldb Test Utility&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html"><img src="../images/db/home.png" alt="Home"></a></td><td valign="top" align="right" width="40%">&nbsp;Chapter&nbsp;4.&nbsp;Transfer Tool</td>
</tr>
</table>
</div>
</body>
</html>
